-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#2002] Add explicit return type annotations to TypeScript functions in *.vue files #2125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! We might even want to add a linter rule for explicit return types. Also, I think the title should include the issue number in front!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on working on your first frontend PR! Have left some minor comments to address. I hope adding the types helped you get acquainted well with the frontend codebase!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this! I believe most of the raw .ts
files are still lacking return types - it might be too much for one PR and I'm ok with having this PR focus on just the functions in .vue
files! In that case, we might want to update the title of this PR to reflect that, and change "Fixes" to "Part of" to prevent this PR from closing the entire issue.
Also as Jonas mentioned, it might be worth looking into if there's an eslint rule that can help enforce the return types! I believe it's possible to only enable the rule for .vue
files too, and we can proceed to enable it for general .ts
files once that portion has been completed in a separate PR.
@supermii2 Remember to add the issue number in the front of the title! |
The following links are for previewing this pull request:
|
Commit to be reverted later
Merge Typescript to Master
Suggestion added, thank you! |
Thanks for your changes @supermii2! If we are going ahead with the plan of splitting up the issue into two PRs (one for typescript functions inside Vue components, and one for functions in raw Additionally, could you update the title of this PR and the action statement ( The linting rule(s) can be added in a separate PR too, I've made an issue to track it in the meantime: #2156 |
Hi, I've had to change the linting rules for unused variables to use the one built for typescript because it was creating false positives. Thank you! I'll revert the changes done to *.ts in the commit after this comment. |
Could you elaborate (maybe with some examples) regarding the false positives, and how changing the rule fixes it? Also, could you check on the grammar of the final sentence in the proposed commit message? Thanks! |
@supermii2 bump on this, I think this PR is almost complete, just need some small changes and we can merge this in |
Here's a potential false positive found in c-zoom.vue. The default no-unused-vars marks a and b used in the return type as unused variables, which is fixed by using the typescript version. |
Got it, thanks for clarifying! There's now merge conflicts introduced by #2132 that have to be resolved before we can merge this PR. Also as mentioned, could you check on the grammar of the final sentence in the proposed commit message? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @supermii2, I added the missing return types for the new file (c-zoom-commit-message
) & updated the proposed commit message to move this PR along for now.
Please take note for future that whenever you finish the requested changes, do re-request a review and/or let us know the PR is ready for review again.
Thanks again for your work on this PR!
Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for your work @supermii2. If you'd like to work further on the frontend, you can create a new PR for adding explicit return type annotation for functions in the raw .ts
files as well.
The following links are for previewing this pull request:
|
Part of #2002